package model;

import java.util.Enumeration;
import java.util.Vector;

import dao.PaymentDAO;

public class ListPayment {
	private Vector payments;
	private PaymentDAO paymentDAO;
	private int id = 0;

	public ListPayment() {
		payments = new Vector();
	}

	public void connect() {
		paymentDAO = new PaymentDAO();
	}


	public void addPayment(Payment e) {
		Payment e1 = new Payment(e.getCustomer_id(), e.getEmployee_id(),
				e.getPayment_Amount(), e.getReservation_id());
		payments.addElement(e1);
	}

	// search by (id,customerid, employeeid,.....)

	// search by id
	public Payment getPaymentByID(int id) {
		Enumeration emp = payments.elements();
		while (emp.hasMoreElements()) {
			Payment each = (Payment) emp.nextElement();
			if (id == each.getCustomer_id()) {
				return each;
			}
		}
		return new Payment();
	}
}
